package javao.cn.work.orc.common.exception;


import javao.cn.work.orc.common.responsTool.ResCode;

/**
 * 自定义业务异常
 */
public class OrcException extends RuntimeException {

    private String msg;
    /**
     *  500初始值异常的意思
     */
    private int code = ResCode.INTERNAL_SERVER_ERROR.getCode();

    /**
     * 多参数构造方法
     * @param msg
     */
    public OrcException(String msg) {
        super(msg);
        this.msg = msg;
    }

    /**
     * 添加Throwable构造
     * @param msg
     * @param e
     */
    public OrcException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    /**
     * 添加code构造器 500初始值异常的意思
     * @param msg
     * @param code
     */
    public OrcException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    /**
     * 重载多参数构造器
     * @param msg
     * @param code
     * @param e
     */
    public OrcException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
